﻿using System.Web.Mvc;
using Kooboo.Web.Mvc;
using System.IO;

namespace Kooboo.CMS.Modules.Areas.NewsModule
{
    public class NewsModuleAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "SalesModule";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "SalesModule_default",
                "SalesModule/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );

            Kooboo.Web.Mvc.Menu.MenuFactory.RegisterAreaMenu(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "Menu.config"));
            Kooboo.Web.Mvc.WebResourceLoader.ConfigurationManager.RegisterSection(AreaName, Path.Combine(Settings.BaseDirectory, "Areas", AreaName, "WebResources.config"));
        }
    }
}
